]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
environment: Remove usage of _blockMethod; we've fixed both Clutter and GDK
authorColin Walters <walters@verbum.org>
Tue, 14 Jun 2011 20:04:32 +0000 (16:04 -0400)
committerColin Walters <walters@verbum.org>
Mon, 20 Jun 2011 21:58:40 +0000 (17:58 -0400)
See bug 597292.

https://bugzilla.gnome.org/show_bug.cgi?id=652597

js/ui/environment.js

index 4a78b84a7ee165d82585231e5db0c07dd39e3545..93c6b39b6e272af8ac2dba940606164356c39baa 100644 (file)
@@ -39,35 +39,6 @@ function _patchContainerClass(containerClass) {
     };
 }
 
-// Replace @method with something that throws an error instead
-function _blockMethod(method, replacement, reason) {
-    let match = method.match(/^(.+)\.([^.]+)$/);
-    if (!match)
-        throw new Error('Bad method name "' + method + '"');
-    let proto = 'imports.gi.' + match[1] + '.prototype';
-    let property = match[2];
-
-    if (!global.set_property_mutable(proto, property, true))
-        throw new Error('Bad method name "' + method + '"');
-
-    // eval() is evil in general, but we know it's safe here since
-    // set_property_mutable() would have failed if proto was
-    // malformed.
-    let node = eval(proto);
-
-    let msg = 'Do not use "' + method + '".';
-    if (replacement)
-        msg += ' Use "' + replacement + '" instead.';
-    if (reason)
-        msg += ' (' + reason + ')';
-
-    node[property] = function() {
-        throw new Error(msg);
-    };
-
-    global.set_property_mutable(proto, property, false);
-}
-
 function init() {
     // Add some bindings to the global JS namespace; (gjs keeps the web
     // browser convention of having that namespace be called 'window'.)
@@ -99,11 +70,6 @@ function init() {
             return base;
     };
 
-    _blockMethod('Clutter.Event.get_state', 'Shell.get_event_state',
-                 'gjs\'s handling of Clutter.ModifierType is broken. See bug 597292.');
-    _blockMethod('Gdk.Window.get_device_position', 'global.get_pointer',
-                 'gjs\'s handling of Gdk.ModifierType is broken. See bug 597292.');
-
     // Now close the back door to prevent extensions from trying to
     // abuse it. We can't actually delete it since
     // Shell.Global.prototype itself is read-only.